using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using Microsoft.Practices.CompositeUI;

namespace OrdersManager.Module.Services
{
    public class LocalOrderWorkflowMappingCollection : IOrderWorkflowMappingCollection<Guid, Guid>
    {
        private Dictionary<Guid, Guid> _orderWorkflowStore = new Dictionary<Guid, Guid>();

        public bool Contains(Guid id)
        {
            return _orderWorkflowStore.ContainsKey(id);
        }

        public void Add(Guid id, Guid instanceId)
        {
            _orderWorkflowStore.Add(id, instanceId);
        }

        public void Remove(Guid id)
        {
            _orderWorkflowStore.Remove(id);
        }

        public bool TryGetValue(Guid id, out Guid instanceId)
        {
            return _orderWorkflowStore.TryGetValue(id, out instanceId);
        }

        IEnumerator<KeyValuePair<Guid, Guid>> IEnumerable<KeyValuePair<Guid, Guid>>.GetEnumerator()
        {
            return _orderWorkflowStore.GetEnumerator();
        }

        public IEnumerator GetEnumerator()
        {
            return _orderWorkflowStore.GetEnumerator();
        }

    }

}
